package com.xcity.game.equip.template;

import com.xcity.game.combat.attr.CombatAttributeType;
import com.xcity.game.equip.EquipPosition;
import com.xcity.game.equip.EquipQuality;

import naga.x.game.template.Template;
import naga.x.game.template.TemplateException;
import naga.x.game.template.annotation.Excel;

/**
 * 装备产出（属性）
 * @author yang.li
 *
 */
@Excel(value = "equip.xlsx", sheet = 3)
public class EquipAttrWeightTemplate extends Template {

	/** 装备部位(0=衣服，1=手包，2=手表，3=鞋子) */
	protected EquipPosition pos;

	/** 装备品质（0=D，1=C，2=B，3=A，4=AA，5=AAA，6=S） */
	protected EquipQuality quality;

	/** 攻击（产出权重） */
	protected int attackPower;

	/** 技能攻击（产出权重） */
	protected int magicPower;

	/** 防御（产出权重） */
	protected int defense;

	/** 技能防御（产出权重） */
	protected int magicDefense;

	/** 暴击（产出权重） */
	protected int crit;

	/** 韧性（产出权重） */
	protected int avoidCrit;

	/** 生命值（产出权重） */
	protected int hp;

	/** 出手速度 */
	protected int attackSpeed;

	/** 物攻命中 */
	protected int hitRate;

	/** 法攻命中 */
	protected int magicHitRate;

	/** 闪避 */
	protected int dodge;

	public EquipPosition getPos() {
		return pos;
	}

	public void setPos(EquipPosition pos) {
		this.pos = pos;
	}

	public EquipQuality getQuality() {
		return quality;
	}

	public void setQuality(EquipQuality quality) {
		this.quality = quality;
	}

	public int getAttackPower() {
		return attackPower;
	}

	public void setAttackPower(int attackPower) {
		this.attackPower = attackPower;
	}

	public int getMagicPower() {
		return magicPower;
	}

	public void setMagicPower(int magicPower) {
		this.magicPower = magicPower;
	}

	public int getDefense() {
		return defense;
	}

	public void setDefense(int defense) {
		this.defense = defense;
	}

	public int getMagicDefense() {
		return magicDefense;
	}

	public void setMagicDefense(int magicDefense) {
		this.magicDefense = magicDefense;
	}

	public int getCrit() {
		return crit;
	}

	public void setCrit(int crit) {
		this.crit = crit;
	}

	public int getAvoidCrit() {
		return avoidCrit;
	}

	public void setAvoidCrit(int avoidCrit) {
		this.avoidCrit = avoidCrit;
	}

	public int getHp() {
		return hp;
	}

	public void setHp(int hp) {
		this.hp = hp;
	}

	public int getAttackSpeed() {
		return attackSpeed;
	}

	public void setAttackSpeed(int attackSpeed) {
		this.attackSpeed = attackSpeed;
	}

	public int getHitRate() {
		return hitRate;
	}

	public void setHitRate(int hitRate) {
		this.hitRate = hitRate;
	}

	public int getMagicHitRate() {
		return magicHitRate;
	}

	public void setMagicHitRate(int magicHitRate) {
		this.magicHitRate = magicHitRate;
	}

	public int getDodge() {
		return dodge;
	}

	public void setDodge(int dodge) {
		this.dodge = dodge;
	}

	public int getWeight(CombatAttributeType type) {
		switch (type) {
			/** 普攻 */
			case ATTACK_POWER:
				return attackPower;
			/** 法攻 */
			case MAGIC_POWER:
				return magicPower;
			/** 普防 */
			case DEFENSE:
				return defense;
			/** 法防 */
			case MAGIC_DEFENSE:
				return magicDefense;
			/** 暴击 */
			case CRIT:
				return crit;
			/** 韧性 */
			case AVOID_CRIT:
				return avoidCrit;
			/** 生命值 */
			case HP:
				return hp;
			/** 出手速度 */
			case ATTACK_SPEED:
				return attackSpeed;
			/** 闪避 */
			case DODGE:
				return dodge;
			/** 物攻命中 */
			case HIT_RATE:
				return hitRate;
			/** 法攻命中 */
			case MAGIC_HIT_RATE:
				return magicHitRate;
			default:
				return 0;
		}
	}

	@Override
	public void validate() throws TemplateException {}
}
